package com.bifrost.entity;

import com.bifrost.constant.BonusPointsSource;
import com.bifrost.constant.BonusPointsUpdatedDetail;
import com.bifrost.constant.BonusPointsUpdatedType;
import com.fasterxml.jackson.annotation.JsonIgnore;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;

/**
 * 外部异常订单
 * @author joewee
 * @date 2018/1/9
 */
@Entity
@Table(name = "BONUS_EXCEPTION_ORDER",indexes = {
        @Index(name = "CARD_NUMBER_NUMBER",columnList = "CARD_NUMBER,NUMBER",unique = true)
})
@NamedQuery(name = "BonusExceptionOrder.findAll", query = "SELECT p FROM BonusExceptionOrder p")
public class BonusExceptionOrder implements Serializable{

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "ID", unique = true, nullable = false)
    private Long id;

    /**
     * 业务相关凭证号、包括但不限于订单号、券号
     */
    @Column(name = "NUMBER", length = 32,nullable = false)
    private String number;

    /**
     * 原单号
     */
    @Column(name = "ORIGIN_NUMBER", length = 32)
    private String originNumber;


    /**
     * 会员卡号
     */
    @Column(name = "CARD_NUMBER", length = 32,nullable = false)
    private String cardNumber;

    /**
     * 门店号
     */
    @Column(name = "MERCHANT_ID")
    private Long merchantId;

    /**
     * 门店编码
     */
    @Column(name = "STORE_CODE",length = 8)
    private String storeCode;

    /**
     * 备注
     */
    @Column(name = "REMARK")
    private String remark;

    /**
     * 最后修改时间
     */
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "LAST_MODIFY_TIME")
    private Date lastModifyTime;

    /**
     * 创建时间
     */
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "CREATED_TIME")
    private Date createdTime = new Date();

    /**
     * 记录原始数据
     * */
    @Column(name = "DATA")
    @Lob
    @JsonIgnore
    private String data;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public String getOriginNumber() {
        return originNumber;
    }

    public void setOriginNumber(String originNumber) {
        this.originNumber = originNumber;
    }

    public String getCardNumber() {
        return cardNumber;
    }

    public void setCardNumber(String cardNumber) {
        this.cardNumber = cardNumber;
    }

    public Long getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(Long merchantId) {
        this.merchantId = merchantId;
    }

    public String getStoreCode() {
        return storeCode;
    }

    public void setStoreCode(String storeCode) {
        this.storeCode = storeCode;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Date getLastModifyTime() {
        return lastModifyTime;
    }

    public void setLastModifyTime(Date lastModifyTime) {
        this.lastModifyTime = lastModifyTime;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }
}
